{% extends "base.html" %}
{% block  title %}资产增改{% endblock %}
{% block header-css %}
    {% load bootstrap3 %}
{% endblock %}


{% block page-content %}

    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>资产增改</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="/index.html">主页</a>
                </li>
                <li>
                    <a href="{% url    'asset:asset_list' %}">资产管理</a>
                </li>
                <li class="active">
                    <strong>资产增改</strong>
                </li>
            </ol>
        </div>
        <div class="col-lg-2">

        </div>
    </div>


    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>资产增改</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="#">选项 1</a>
                            </li>
                            <li><a href="#">选项 2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">

                    <form enctype="multipart/form-data" method="post" class="form-horizontal" action="">
                        {% csrf_token %}
                        {% if form.non_field_errors %}
                            <div class="alert alert-danger" style="margin: 20px auto 0px">
                                {{ form.non_field_errors }}
                            </div>
                        {% endif %}

                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-0">
                                <h3>基本</h3>
                                {% bootstrap_field form.hostname layout="horizontal" %}
                                {% bootstrap_field form.network_ip layout="horizontal" %}
                                {% bootstrap_field form.inner_ip layout="horizontal" %}
                                {% bootstrap_field form.platform layout="horizontal" %}
                                {% bootstrap_field form.region layout="horizontal" %}
                                  {% bootstrap_field form.project layout="horizontal" %}
                                {% bootstrap_field form.business layout="horizontal" %}
                                {% bootstrap_field form.user layout="horizontal" %}
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>


                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-0">
                                <h3>可自动获取</h3>
                                {% bootstrap_field form.system layout="horizontal" %}
                                {% bootstrap_field form.cpu layout="horizontal" %}
                                {% bootstrap_field form.memory layout="horizontal" %}
                                {% bootstrap_field form.disk layout="horizontal" %}
                            </div>
                        </div>

                        <input type="hidden" name="__next__" value="{{ i__next__ }}">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-10">
                                <h3>其他</h3>
                                {% bootstrap_field form.Instance_id layout="horizontal" %}
                                {% bootstrap_field form.bandwidth layout="horizontal" %}
                                {% bootstrap_field form.port layout="horizontal" %}
                                {% bootstrap_field form.vars layout="horizontal" %}
                                {% bootstrap_field form.ps layout="horizontal" %}
                                {% bootstrap_field form.is_active layout="horizontal" %}


                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>


                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">

                                {% bootstrap_button "保存" button_type="submit" button_class="btn-primary" %}

                                  <a class="btn btn-white" href="{{ i__next__ }}">取消</a>

                            </div>
                        </div>

                    </form>


                </div>
            </div>
        </div>

    </div>


    {% block footer-js %}
        <script>
            $(document).ready(function () {
                $('.select2').select2();
                $("#id_tags").select2({
                    tags: true,
                    {#                                maximumSelectionLength: 8,  //最多能够选择的个数#}
                    closeOnSelect: false
                });
            });

            {#            $('#id_platform').change(function () {#}
            {#                var name = $('#id_platform').val();#}
            {##}
            {#                $.getJSON("{% url 'asset:asset_getdata' %}?name=" + name, function (data, textStatus) {#}
            {##}
            {#                    var content = '';#}
            {#                    $.each(data, function (i, item) {#}
            {#                        content += '<option   value=' + item.pk + '>' + item.fields.name + '</option>'#}
            {#                    });#}
            {#                    $('#id_region').html(content)#}
            {#                });#}
            {#            });#}


        </script>
    {% endblock %}



{% endblock %}


